import {
  post,
  get,
  del
} from "@/utils/request";

// 添加购物车
export const addToCart = (product, num = 1) =>
  post("/api/v1/shop_carts", {
    product,
    quantity: num,
  });

//   获取购物车列表
export const reqCartlistAPI = () => get("/api/v1/shop_carts");
// // 单个删除购物车
export const reqDelcartAPI = (id) => del(`/api/v1/shop_carts/${id}`);

// // 删除多个购物车
export const reqDelCartsAPI = (ids) =>
  post("/api/v1/shop_carts/delmany", {
    ids
  }); // ['id1','id2']